home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / telecomm / fnordadl / fn132src.zoo / man / manfilt.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-09-02  |  278 b   |  23 lines

  1. #include <stdio.h>
  2.  
  3. main(int argc, char **argv)
  4. {
  5.     register int c, cr = 0;
  6.  
  7.     if (stdin == NULL || stdout == NULL)
  8.         exit(-1);
  9.  
  10.     while ((c = getchar()) != EOF) {
  11.         if (c == '\n') {
  12.             cr++;
  13.             if (cr < 3)
  14.                 putchar(c);
  15.         }
  16.         else {
  17.             cr = 0;
  18.             putchar(c);
  19.         }
  20.     }
  21.     exit(0);
  22. }
  23.